package com.example.servicehi.controller;
import com.example.servicehi.client.NewsMapper;
import com.example.servicehi.dao.News;
import com.example.servicehi.mapper.UserMapper;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


@RestController
public class UserController {
    @Resource
    private UserMapper userMapper;
    @Resource
    private NewsMapper newsMapper;

    @GetMapping("/{nickname}")
    @ResponseBody
    public String getUserByName(@PathVariable String nickname){
        return "nickname:"+nickname+" user_id="+userMapper.getUserByName(nickname)+"<br>result:<br>"+newsMapper.getNewsByUserId(userMapper.getUserByName(nickname)).toString();
    }




}
